package com.yiding.sys.common.enums;

/**
 * @author War horse imwarhorse@aliyun.com
 * Date: 2020/4/27
 * Description: 统一响应码枚举类
 * 1xxx为业务异常；
 * 2xxx为服务异常；
 * 3xxx为权限异常；
 * ……
 */

public enum ResultCodeEnum {

	SUCCESS(0, "SUCCESS"),
	FAILED(1, "FAILED"),

	CREDENTIALS_ILLEGAL(3001, "用户名或密码错误"),
	LOCKED_ACCOUNT(3002, "用户已锁定"),
	ILLEGAL_TOKEN(3003, "非法Token令牌"),
	UNAUTHORIZED(3004, "权限不足"),
	UNAUTHENTICATED(3005, "未认证"),
	OCCUPIED_USERNAME(3006, "用户名已被占用");

	private int code;
	private String name;

	ResultCodeEnum(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public int getCode() {
		return code;
	}

	public String getName() {
		return name;
	}
}
